import { defineStore } from 'pinia';
import service from '/@/utils/request';
import { query } from '/@/utils/params';
export interface Account {
	id: string;
	account: string;
	password: string;
	status: string;
	createAt: string;
}

export const useAccount = defineStore('accountStore', {
	state: (): {
		list: Account[];
		total: number;
	} => {
		return {
			list: [],
			total: 0,
		};
	},

	actions: {
		getAccountData(params: { account: string; pageSize: number; pageNumber: number }) {
			return service.get(query('/api/account', params)).then((res) => {
				// this.list = res.list;
				// this.total = res.total;
				console.log(res);
				return res;
			});
		},
	},
});
